package service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import dao.impl.GenericDao;

public class GenericService<T> implements IService<T> {

    private GenericDao<T> genericDao;

    @Autowired
    public void setGenericDao(GenericDao<T> genericDao) {
        this.genericDao = genericDao;
    }

    public T get(long id) {
        return genericDao.get(id);
    }

    public List<T> getAll() {
        return genericDao.getAll();
    }

    public void createOrUpdate(T t) {
        genericDao.saveOrUpdate(t);
    }

    public void delete(T t) {
        genericDao.delete(t);
    }

}
